<html lang="en">
<head>
  <meta charset="UTF-8">
  <style>
    body { flow: vertical; }
    #LOG { size: *; }
    #CMD { width:*; }
  </style>
  <script type=module>
    import * as debug from "@debug";
    console.log("dd",debug.setConsoleOutputHandler)
    debug.setConsoleOutputHandler((...msg) => {
      console.log("ccc",msg)
      return true;
    });
    debug.setUnhandledExeceptionHandler((err) => {
     
      return true;
    });

    CMD.on("keydown", (evt,el) => {
      if( evt.code != "KeyRETURN" ) return;
      let toeval = el.value.trim();
      if( !toeval ) return;
      try {
        var r = eval(toeval);
        console.log(r);
      } catch(e) {
        console.warn(e.message);
      }
      return true;
    });
  </script>
</head>
<body>
  <select|list multiple #LOG></select>
  <div#LOG></div>
  <input #CMD placeholder="eval" spellcheck="false" />
</body>
</html>